<?php if ( !defined('BASEPATH')) exit ('No direct script access allowed');

class admin extends CI_Controller
{
    public function __construct() 
    {
        parent::__construct();
        $this->load->model('admin_model');
    }
    
    public function index() {
       
            $this->load->view("login_view.php");
        
    }

    public function login() {
     
        $username = $this->input->post('uname');
        $password = md5($this->input->post('pass'));
 
        $result = $this->admin_model->login($username, $password);
        if ($result) {
              
             redirect('GSD_admin/user_view');
        } else {
            print('aw');
            $this->index();
        }
    }
	 
	
	public function userprofile() 
    {
        $this->user_profile();
    }
  
    
    public function home() 
    {
        $this->load->library('table');
		$this->load->helper('html');
		$this->load->model('admin_model');
		$data = $this->admin_model->menu();        
        $this->load->view("home_view.php",$data);
		
    }
    
    public function view_user() 
    {
        $this->load->library('table');
		$this->load->helper('html');
		$this->load->model('admin_model');
		$data = $this->admin_model->menu();        
        $this->load->view("user_view.php",$data);
    }
	
	public function user_profile() 
    {
        $this->load->library('table');
		$this->load->helper('html');
		$this->load->model('admin_model');
		$data = $this->admin_model->menu();        
        $this->load->view("userprofile.php",$data);
	
    }
	
	
	
	 public function club() 
    {
        $this->load->library('table');
		$this->load->helper('html');
		$this->load->model('admin_model');
		$data = $this->admin_model->menu();        
        $this->load->view("view_club.php",$data);
    }
	
	
	public function add_club() 
    {
        $this->load->library('table');
		$this->load->helper('html');
		$this->load->model('admin_model');
		$data = $this->admin_model->menu();        
        $this->load->view("addclub.php",$data);
    }
	
	
	 public function tournaments() 
    {
        $this->load->library('table');
		$this->load->helper('html');
		$this->load->model('admin_model');
		$data = $this->admin_model->menu();        
        $this->load->view("tournaments.php",$data);
		$this->load->view("footer_view.php",$data);
    }
	
	 public function tournamentpage() 
    {
        $this->load->library('table');
		$this->load->helper('html');
		$this->load->model('admin_model');
		$data = $this->admin_model->menu();        
        $this->load->view("tournamentviewpage.php",$data);
		$this->load->view("footer_view.php",$data);
    }
	
	
    public function registration() 
    {
        $this->load->library('table');
		$this->load->helper('html');
		$this->load->model('admin_model');
		$data = $this->admin_model->menu();        
        $this->load->view("registration_view.php",$data);
    }
}
